package xyz.sicau.blog.service;

import org.springframework.stereotype.Service;
import xyz.sicau.blog.bean.User;
import xyz.sicau.blog.dao.UserMapper;

import javax.annotation.Resource;

@Service
public class UserService {
    @Resource
    UserMapper userMapper;

    // 注册用户
    public int registUser(String username, String password){
        User user = new User();
        user.setUserName(username);
        user.setUserPswd(password);
        // 插入用户名密码表
        userMapper.insertUserLogin(user);
        System.out.println("注册用户"+ user);
        // 插入用户信息表
        return userMapper.insertUser(user);
    }
}
